/**
 * Created by hcadmin on 16/3/11.
 */
/**
 * Created by hcadmin on 16/3/11.
 */

define([
    "jquery",
    "IO",
    "UPLOADUI",
    "UPLOAD",
    "jqueryUI",
    "bootbox",
    //"text!/js/biz/keb/activity/definebt.html"
], function ($, IO, upui, up, jui, bootbox, definebt) {


    $(document).on("click",".publish",function(){

       // alert("click");


        var id = $("#id").val();
        var title = $("#title").val();
        var price = $("#price").val();




        var content = editor.html();
        var param = {id :id ,title:title,price:price,content:content};

        if(title==""){
            alert("请输入标题");
            return;
        }
        if(content==""){
            alert("请输入内容");
            return;
        }

        if(price==""){
            alert("请输入工本费");
            return;
        }

        //console.log(param);

        //alert(param);

        //return;
        if(param&&param!='undefined'){
            bootbox.confirm("确定要修改证书",function(result){
                if(result) {
                    IO.post("act/uCertificate",param,function(d){
                        bootbox.alert(d.msg,function(){
                            if (d.code == 0) {
                                location.href = '/pte/renzhenginfo';
                            }
                        })
                    });
                }
            });
        }
    })
});

